<admintpl file="header" />
<style>
	*{margin:0; padding:0;}
	body{font-family: "Microsoft Yahei", "hiragino sans gb", Helvetica, Arial, Tahoma;}
	.c-tan-shadow{position: fixed; left:0; top:0; width:100%; height:100%; background: rgba(0,0,0,0.3); display:none;}
        .c-tan-box{width:auto; padding:20px 40px 30px; height:auto; background: #fff;position: fixed; left:50%;  top:50%; margin-top:-120px; margin-left:-274px; display:none;}
        .c-tan-box table{border-collapse: collapse; width: 400px;}
        .c-tan-box table td{border:1px solid #000; text-align: center; padding:8px 10px;}
        .c-tan-title{text-align: center; position: relative; height:30px; line-height: 30px; padding-bottom:20px; font-size: 16px;}
        .c-tan-title .c-tan-xiao{ position: absolute; right:0; top:0; width:50px; height:30px; line-height: 30px; cursor: pointer; font-size: 12px;}
        .c-tan-title .c-tan-xiao:hover{ color: #f0080b;}
        .c-tan-center{max-height:220px; width: 420px; overflow:auto;}
	 .c-pages{padding:20px 0; text-align: center;}
	.c-pages.tl{text-align: left;}
	.c-pages span{display: inline-block; margin-right: 5px; font-size:12px; height:28px; line-height: 28px;}
	.c-pages span.col{color: #fe344e; font-weight: 600;}
	.c-pages span a{display: inline-block; margin:0 3px; height:28px; line-height: 28px; text-align: center; padding:0 12px; border:1px solid #ccc; text-decoration: none; border-radius: 2px;}
	.c-pages span a:link,.c-pages span a:active,.c-pages span a:visited{color: #333;}
	.c-pages span a:hover{ color: #ff8540; }
	.c-pages span a.active{color: #fff; background: #ff8540;}
	.c-pages  .current{ color: #fff; background: #ff8540; display: inline-block; margin: 0 3px; height: 28px;
		line-height: 28px;
		text-align: center;
		padding: 0 12px;
		text-decoration: none;
		border-radius: 2px;
	}

</style>
</head>
<body>
<div class="wrap">
	<ul class="nav nav-tabs">
		<li class="active"><a>会员管理</a></li>
	</ul>
	<form class="well form-search" method="post" action="{:U('Member/index')}">
	会员：
			<input type="text" name="accounts" style="width: 220px;" value="{:I('request.accounts')}" placeholder="请输入会员账号/手机号/银行卡号">&nbsp;&nbsp;
	注册时间:
			<input type="text" class="js-date" name="stime" value="{$kaishi}" style="width: 90px;" autocomplete="off">至
			<input type="text" class="js-date" name="etime" value="{$jieshu}" style="width: 90px;" autocomplete="off">&nbsp;&nbsp;
	等级:
			<select name="grade" style="width: 80px">
			   <option value="0">请选择</option>
				<option value="1" <?php if($grade==1){echo 'selected';} ?>>VIP1</option>
				<option value="2" <?php if($grade==2){echo 'selected';} ?>>VIP2</option>
				<option value="3" <?php if($grade==3){echo 'selected';} ?>>VIP3</option>
				<option value="4" <?php if($grade==4){echo 'selected';} ?>>VIP4</option>
				<option value="5" <?php if($grade==5){echo 'selected';} ?>>VIP5</option>
				<option value="6" <?php if($grade==6){echo 'selected';} ?>>VIP6</option>
				<option value="7" <?php if($grade==7){echo 'selected';} ?>>VIP7</option>
				<option value="8" <?php if($grade==8){echo 'selected';} ?>>VIP8</option>
				<option value="9" <?php if($grade==9){echo 'selected';} ?>>VIP9</option>
			</select>&nbsp;&nbsp;
	有效会员:
			<select name="youxiao" style="width: 70px">
				<option value="0">全部</option>
				<option value="1" <?php if($youxiao=='1'){echo 'selected';} ?>>是</option>
				<option value="2" <?php if($youxiao=='2'){echo 'selected';} ?>>否</option>
			</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="{:U('Member/index')}">清空</a>
	</form>
	<form method="post" class="js-ajax-form">
		<php>$type=array("1"=>"是","2"=>"否");</php>
		<php>$sex=array("1"=>"男","2"=>"女","3"=>"保密");</php>
		<table class="table table-hover table-bordered">
			<thead>
			<tr>
				<th style="text-align: center">用户ID</th>
				<th style="text-align: center">用户帐号</th>
				<th style="text-align: center">代理账户</th>
				<th style="text-align: center">等级</th>
				<th style="text-align: center">代理报表</th>
				<th style="text-align: center">下级报表</th>
				<th style="text-align: center">操作</th>
			</tr>
			</thead>
			<tbody>
			<?php if($arr){ ?>

			<foreach name="arr" item="vo">

				<tr>
					<td style="text-align: center">{$vo.userid}</td>
					<td style="text-align: center">{$vo.accounts}</td>
					<td style="text-align: center"><php>echo $type[$vo['utype']];</php></td>
					<td style="text-align: center">
						<?php if($vo['score'] < '10'){echo 'VIP1';}
                                  elseif('10' <= $vo['score'] && $vo['score'] < '200'){echo 'VIP2';}
                                  elseif('200' <= $vo['score'] && $vo['score'] < '1000'){echo 'VIP3';}
                                  elseif('1000' <= $vo['score'] && $vo['score'] < '10000'){echo 'VIP4';}
                                  elseif('10000' <= $vo['score'] && $vo['score'] < '50000'){echo 'VIP5';}
                                  elseif('50000' <= $vo['score'] && $vo['score'] < '250000'){echo 'VIP6';}
                                  elseif('250000' <= $vo['score'] && $vo['score'] < '1000000'){echo 'VIP7';}
                                  elseif('1000000' <= $vo['score'] && $vo['score'] < '5000000'){echo 'VIP8';}
                                  elseif('5000000' <= $vo['score']){echo 'VIP9';}; ?>
					</td>
					<td  style="text-align: center"><a href="{:U('Member/agentReport',array('id'=>$vo['userid']))}">查看</a></td>
					<td style="text-align: center"><a href="{:U('Member/agent',array('id'=>$vo['userid']))}">查看</a></td>
					<td style="text-align: center">
						<a href="{:U('Member/detail',array('id'=>$vo['userid']))}">详情</a> |
						<a style="cursor: pointer;" onclick="fen({$vo.userid})">支付方式</a> |
						<php>if($vo['frozen'] == 0){</php>
						<a href="{:U('Member/frozen',array('id'=>$vo['userid'],'type'=>1))}">冻结</a>
						<php>}else{</php>
						<a href="{:U('Member/frozen',array('id'=>$vo['userid'],'type'=>0))}">解冻</a>
						<php>}</php>  |
						<a href="{:U('Member/del_user',array('id'=>$vo['userid']))}">删除</a>
					</td>
				</tr>
			</foreach>
			<?php }else{ ?>
				<tr>
					<td style="text-align: center;" colspan="10">未搜索到相关数据</td>
				</tr>
			<?php } ?>
			</tbody>
		</table>
		<div class="c-pages tc">
			<span>{$page}第{$p}页/共{$totalpage}页</span>
		</div>
	</form>
<div class="c-tan-shadow"></div>
<div class="c-tan-box">
	<div class="c-tan-title">设置支付方式 <span class="c-tan-xiao">关闭</span></div>
	<div class="c-tan-center">
		<table>
			<tr>
				<td>选择</td>
				<td>等级</td>
			</tr>
			<tr>
				<td><input class="xzRadio" type="radio" name="cra"  value="1"/></td>
				<td>VIP1</td>
			</tr>
			<tr>
				<td><input class="xzRadio" type="radio" name="cra" value="2 " /></td>
				<td>VIP2</td>
			</tr>
			<tr>
				<td><input class="xzRadio" type="radio" name="cra" value="3"/></td>
				<td>VIP3</td>
			</tr>
			<tr>
				<td><input class="xzRadio" type="radio" name="cra" value="4"/></td>
				<td>VIP4</td>
			</tr>
			<tr>
				<td><input class="xzRadio" type="radio" name="cra" value="5"/></td>
				<td>VIP5</td>
			</tr>
			<tr>
				<td><input class="xzRadio" type="radio" name="cra" value="6"/></td>
				<td>VIP6</td>
			</tr>
			<tr>
				<td><input class="xzRadio" type="radio" name="cra" value="7"/></td>
				<td>VIP7</td>
			</tr>
			<tr>
				<td><input class="xzRadio" type="radio" name="cra" value="8"/></td>
				<td>VIP8</td>
			</tr>
			<tr>
				<td><input class="xzRadio" type="radio" name="cra" value="9"/></td>
				<td>VIP9</td>
			</tr>
		</table>
	</div>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>

	function fen(id){
//		var uid = id;
//		$.ajax({
//			type: "POST",
//			url: "{:U('Member/chanzhao_vip')}",
//			data: {uid:uid},
//			success: function(data){
//				var vip = data;
//				$(".xzRadio").val(vip);
//                $(".xzRadio").eq(vip-1).prop("checked",true);
//			}
//		});
		window.gid = id;
        $(".c-tan-shadow,.c-tan-box").show();

	}

    $(".c-tan-xiao").click(function(){
        $(".c-tan-shadow,.c-tan-box").hide();
    });

    $(".xzRadio").click(function(){
		var cva = $(':radio[name="cra"]:checked').val();

		if(confirm("确定要设置为VIP"+cva+"??")){
			$(".c-tan-shadow,.c-tan-box").hide();
			 $.ajax({
				type: "POST",
				url: "{:U('Member/sz_zhifu')}",
				data: {gid:gid,cva,cva},
				success: function(data){
					$(".xzRadio").eq(data-1).prop("checked",true);
					alert("设置成功");
//					document.location.reload();
				}
			});
		}else{
			$(".c-tan-shadow,.c-tan-box").hide();
			var cva = $(':radio[name="cra"]:checked').val();
		}
    })
</script>
</div>
</body>
</html>